<?php
/**
 * Word model
 *
 * PHP version 5
 *
 * @category   Web
 * @package    Data2People
 * @subpackage Models
 * @author     Mike Bevz <mike.bevz@data2people>
 * @copyright  2007-2008 (c) Mike Bevz
 * @license    The BSD License http://data2people.com/license.txt
 * @version    SVN: $Id: Word.php 13 2008-12-01 16:16:50Z michael.bevz $
 *
 */
/**
 * Includes
 */
require_once 'BaseClasses/BaseWord.php';


/**
 * Word model class
 *
 * PHP version 5
 *
 * @category   Web
 * @package    Data2People
 * @subpackage Models
 * @author     Mike Bevz <mike.bevz@data2people>
 * @copyright  2007-2008 (c) Mike Bevz
 * @license    The BSD License http://data2people.com/license.txt
 * @version    SVN: $Id: Word.php 13 2008-12-01 16:16:50Z michael.bevz $
 *
 */
class Word extends BaseWord
{
    /**
     * Return word object by its value
     *
     * @param String $word
     *
     * @return Doctrine_Collection
     */
    public function getWordByWord($word)
    {
        if (!is_string($word)) {
            throw new TV_Model_Exception(__METHOD__ .
                      ': the method requires string as argument, got ' .
                      gettype($word));
        }
        $word = Doctrine_Query::create()->from('Word')
                                        ->addWhere('word =?', array($word))
                                        ->execute();
        return $word;
    }
    
   
    
}